<template>
  <div id="news">
    <van-nav-bar title="消息中心"
      ><template #left
        ><van-icon
          name="arrow-left"
          color="#323232"
          size="20"
          @click="backHome" /></template
    ></van-nav-bar>
    <ul>
      <li v-for="item in list" :key="item.id">
        <img :src="item.url" alt="" />
        <div class="big">
          <div class="one">{{ item.title }}</div>
          <div class="two">{{ item.detail }}</div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "News",
  data() {
    return {
      list: [
        {
          id: 1,
          title: "活动福利",
          detail: "今日半价产品",
          url: require("@/assets/messageImg/1.png"),
        },
        {
          id: 2,
          title: "订单消息",
          detail: "你的商品已送达",
          url: require("@/assets/messageImg/2.png"),
        },
        {
          id: 3,
          title: "客服消息",
          detail: "很抱歉给您造成的不便",
          url: require("@/assets/messageImg/3.png"),
        },
      ],
    };
  },
  methods: {
    backHome() {
      this.$router.push("/home");
    },
  },
  mounted() {
    console.log(this);
  },
};
</script>

<style lang="less" scoped>
#news {
  background-color: #ffffff;
  height: 1460px;
}
.van-nav-bar {
  width: 827px;
  height: 88px;
  background: #ffcc00;
  /deep/.van-nav-bar__title {
    width: 180px;
    height: 88px;
    line-height: 88px;
    margin: auto;
    font-size: 40px;
    font-family: PingFang SC;
    font-weight: 550;
    color: #323232;
  }
  /deep/.van-nav-bar__content {
    height: 88px;
    line-height: 88px;
  }
}
ul {
  width: 748px;
  height: 428px;
  margin: 0 auto;
  margin-top: 42px;
  background: #ffffff;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  padding: 0 40px;
  li {
    display: flex;
    height: 142px;
    line-height: 143px;
    border-bottom: 1px solid gray;
    .big {
      display: flex;
      flex-direction: column;
      margin-left: 20px;
      .one {
        margin-top: -30px;
        width: 200px;
        height: 28px;
        font-size: 30px;
        font-family: PingFang SC;
        font-weight: 500;
        color: #646464;
      }
      .two {
        width: 500px;
        height: 24px;
        margin-top: 27px;
        font-size: 24px;
        font-family: PingFang SC;
        font-weight: 400;
        color: #929292;
      }
    }
    img {
      width: 98px;
      height: 98px;
      margin-top: 22px;
    }
  }
}
</style>
